<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>

    <%@include file="common/head.jsp" %>

</head>

<body>

<%@include file="common/sidebar-user.jsp" %>

<!-- 主内容 -->
<div class="main-content">
    <div class="fluid-container">

        <div class="content-wrapper">

            <div class="page-section">
                <div class="row">
                    <div class="col-md-12">
                        <h4 class="widget-title">BLOG LIST 博文库</h4>
                    </div>
                </div>

                <%@include file="common/search.jsp" %>

                <div class="row projects-holder">
                    <c:forEach items="${pageInfo.list}" var="article">
                        <div class="col-md-4 col-sm-6">
                            <div class="thumbnail" onclick="window.location.href='/article/getArticle?articleId=${article.articleId}'">
                                <img src="${article.articlePicture}" class="img-rounded" alt="...">
                                <div class="caption">
                                    <h3 class="h3-widget-title">${article.articleTitle}</h3>
                                    <p><i class="fa fa-clock-o"></i> 时间：${fn:substring(article.articleCreateDate, 0, 10)} <i class="fa fa-eye"></i> 浏览：${article.articleViews}</p>
                                </div>
                            </div>
                        </div>
                    </c:forEach>
                </div>
                <!-- 分页 -->
                <div class="row text-center" style="margin-top: 20px">
                    总共 ${pageInfo.total } 篇博文
                    <nav aria-label="Page navigation">
                        <ul class="pagination">
                            <li><a href="/article/articleList?pn=1">首页</a></li>
                            <c:if test="${pageInfo.hasPreviousPage }">
                                <li><a href="/article/articleList?pn=${pageInfo.pageNum-1}"
                                       aria-label="Previous"> <span aria-hidden="true">«</span>
                                </a></li>
                            </c:if>

                            <c:forEach items="${pageInfo.navigatepageNums }" var="page_Num">
                                <c:if test="${page_Num == pageInfo.pageNum }">
                                    <li class="active"><a href="#">${page_Num }</a></li>
                                </c:if>
                                <c:if test="${page_Num != pageInfo.pageNum }">
                                    <li>
                                        <a href="/article/articleList?pn=${page_Num }">${page_Num }</a>
                                    </li>
                                </c:if>

                            </c:forEach>
                            <c:if test="${pageInfo.hasNextPage }">
                                <li><a href="/article/articleList?pn=${pageInfo.pageNum+1 }"
                                       aria-label="Next"> <span aria-hidden="true">»</span>
                                </a></li>
                            </c:if>
                            <li><a href="/article/articleList?pn=${pageInfo.pages}">末页</a></li>
                        </ul>
                    </nav>
                </div>
            </div>
            <hr>

            <%@include file="common/footer.jsp" %>

        </div>

    </div>
</div>

<%@include file="common/end.jsp" %>

</body>

</html>